/**
 * This class will implement the messages between entities in our program.
 * Each instance will be a message with sender and receiver.
 * 
 * @author Gil Levinson
 * @author Boris Fradlis
 * @author Yogev Levi
 * @author Hila Porat
 * 
 */

package vcpClasses;

import java.io.Serializable;

// Start of Notification ***************************************************************************

public class Notification implements Serializable{
	
	// Class variables *****************************************************************************
	
	private int nid;
	private String type;
	private Serializable content;
	private String sender;
	private String receiver;
	private boolean read;
	
	// Constructors ********************************************************************************
	
	/**
	 * No implementation constructor
	 */
	
	public Notification() {}
	
	/**
	 * Constructor using the following fields:
	 * @param type type of the message
	 * @param content content of the message
	 * @param sender the sender of the notification
	 */
	
	public Notification(String type, Serializable content, String sender){
		this.setNid(0);
		this.setType(type);
		this.setContent(content);
		this.setSender(sender);
		this.setReceiver(null);
		this.setRead(false);
	}
	
	/**
	 * Creates notification using other notification
	 * @param notification the other notification
	 */

	public Notification(Notification notification) {
		this.setNid(notification.nid);
		this.setType(notification.type);
		this.setContent(notification.content);
		this.setSender(notification.sender);
		this.setReceiver(null);
		this.setRead(false);
	}

	// Getters and Setters ****************************************************************
	
	/**
	 * @return the nid
	 */
	public int getNid() {
		return nid;
	}

	/**
	 * @param nid the nid to set
	 */
	public void setNid(int nid) {
		this.nid = nid;
	}

	/**
	 * @return the type
	 */
	public String getType() {
		return type;
	}

	/**
	 * @param type the type to set
	 */
	public void setType(String type) {
		this.type = type;
	}

	/**
	 * @return the content
	 */
	public Serializable getContent() {
		return content;
	}

	/**
	 * @param content the content to set
	 */
	public void setContent(Serializable content) {
		this.content = content;
	}

	/**
	 * @return the sender
	 */
	public String getSender() {
		return sender;
	}

	/**
	 * @param sender the sender to set
	 */
	public void setSender(String sender) {
		this.sender = sender;
	}

	/**
	 * @return the receiver
	 */
	public String getReceiver() {
		return receiver;
	}

	/**
	 * @param receiver the receiver to set
	 */
	public void setReceiver(String receiver) {
		this.receiver = receiver;
	}

	/**
	 * @return the read
	 */
	public boolean isRead() {
		return read;
	}

	/**
	 * @param read the read to set
	 */
	public void setRead(boolean read) {
		this.read = read;
	}
}
